$(function () {
    let H = $(".gb_main_top").offset().top;
    $(document).on("scroll", function () {
        if ($(window).scrollTop() >= H+50) {
            $(".gb_main_top").css({
                display: "block",
                position: "fixed",
                top: 0,
                zIndex: 999,
                paddingTop: "2px",
                width: "980px",
                height: "40px",
                backgroundColor: "#F4F4EE"
            });
            $(".gb_topfix").css({
                display: "block",
                position: "fixed",
                top: 0,
                zIndex: 999
            });
            $(".gbl_middle").css({
                marginTop: "235px"
            });
            $(".gb_main_main").css({
                marginTop: "40px"
            });
        } else {
            $(".gb_main_top").css({
                position: "static",
            });
            $(".gb_topfix").css({
                position: "relative",
            });
            $(".gbl_middle").css({
                marginTop: "0"
            });
            $(".gb_main_main").css({
                marginTop: "0"
            });
        }
    })
})